package com.JieCheng.controller;

import io.swagger.annotations.ApiOperation;
import org.springframework.boot.autoconfigure.web.ErrorController;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import static io.swagger.models.HttpMethod.GET;

/**
 * Created by Zhang on 2017/5/10.
 */
@Controller
public class MainsiteErrorController implements ErrorController {

    private static final String ERROR_PATH = "/error";

    @ApiOperation(value="404跳转", notes="找不到界面时跳转该地址",httpMethod = "GET")
    @RequestMapping(value=ERROR_PATH)
    public String handleError(){
        return "login";
    }

    @Override
    public String getErrorPath() {
        // TODO Auto-generated method stub
        return ERROR_PATH;
    }

}
